package com.mrjy.maintain.bo;

import com.mrjy.common.dto.UserHappinessDto;
import com.mrjy.common.entity.UserBindEmail;
import com.mrjy.common.entity.UserInfo;
import com.mrjy.common.entity.VideoInfo;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import java.util.List;
import java.util.Map;

public interface IUserInfoBo {
	
	/**
	 * 添加用户后台
	 * @param userInfo
	 */
	public int txmaintainAddUserInfo(UserInfo userInfo);
	
	/**
	 * 添加讲师后台
	 * @param userInfo
	 */
	public int txmaintainAddTeacherInfo(UserInfo userInfo);
	
	

	/**
	 * 快速添加用户前端
	 * @param userInfo
	 * @param typeId 
	 */
	public UserInfo txFastAddUserInfo(UserInfo userInfo,String mobileValCode, Integer typeId);
	
	
	/**
	 * 添加用户前端
	 * @param userInfo
	 */
	public Object txAddUserInfo(UserInfo userInfo,String mobileValCode,Integer typeId);
	
	/**
	 * 用户登录
	 * @param userInfo
	 * @param session 
	 */
	public UserInfo login(UserInfo userInfo, HttpSession session);
	
	/**
	 * 用户信息更新
	 * @param userInfo
	 * @param sessionUserInfo
	 * @return
	 */
	public UserInfo updateById(UserInfo userInfo,UserInfo sessionUserInfo);
	
	/**
	 * 获取当前用户的名下开通的会员
	 * @param sessionUserInfo
	 * @param userInfo   传输的参数
	 * @return
	 */
	public Map<String, Object> getMemberList(UserInfo sessionUserInfo,UserInfo userInfo);
	
	/**
	 * 获取老师的发展会员列表
	 * @param sessionUserInfo
	 * @param userInfo
	 * @return
	 */
	public Map<String, Object> getMemberListAdmin(UserInfo sessionUserInfo,UserInfo userInfo);
	
	/**
	 * 获取老师的发展会员的总数与总额
	 * @param sessionUserInfo
	 * @param userInfo
	 * @return
	 */
	public Map<String, Object> getMemberTotalAdmin(UserInfo sessionUserInfo,UserInfo userInfo);
	
	/**
	 * 导出老师的发展会员列表Excel表格
	 * @param response
	 * @param sessionUserInfo
	 * @param paraInfo
	 * @return
	 */
	public Object exportMemberList(HttpServletResponse response,UserInfo sessionUserInfo,UserInfo paraInfo);
	
	/**
	 * 邮箱检测是否可用
	 * @param email
	 * @param emailSrc 原email
	 * @return
	 */
	public String emailValidate(String email,String emailSrc);
	
	/**
	 * Email绑定发送验证
	 * @param userBindEmail
	 * @return
	 */
	public String emailBind(UserBindEmail userBindEmail , UserInfo userInfo);
	
	/**
	 * 验证手机号码并发送验证码---未绑定手机
	 * @param mobilePhone
	 * @return
	 */
	public Object sendMobilePhoneCode(String mobilePhone);
	/**
	 * 验证手机验证码并绑定手机
	 * @param mobilePhone
	 * @param mobilePhoneCode
	 * @param map
	 * @return
	 */
	public String txPhoneBind(UserInfo userInfo,String mobilePhoneCode);
	
	/**
	 * 发送验证码---登录用户
	 * @param userInfo
	 * @return
	 */
	//public Object sendMobilePhoneCodeLogined(UserInfo userInfo);
	
	/**
	 * 推荐码验证
	 * @param recommendCode
	 * @param recommendCodeSrc
	 * @return
	 */
	public String recommendCodeValidate(String recommendCode,String recommendCodeSrc);
	
	/**
	 * 获取随机推荐码
	 * @return
	 */
	public String getRecommendCode();
	
	/**
	 * 手机号码验证
	 * @param mobilePhone
	 * @param stid   
	 * @return   存在返回error，不存在返回ok
	 */
	public String mobilePhoneValidate(String mobilePhone,String stid);
	
	/**
	 * 更改手机号码
	 * @param mobilePhone
	 * @param sessionUserInfo
	 * @return
	 */
	public String updateMobilePhone(String mobilePhone,UserInfo sessionUserInfo);
	
	/**
	 * 密码验证
	 * @param userInfo
	 * @return
	 */
	public Object passwordValidate(UserInfo userInfo,String passwordSrc);
	/**
	 * 修改密码
	 * @param userInfo
	 * @param passwordNew
	 * @return
	 */
	public Object txChangePassword(UserInfo userInfo,String passwordSrc,String passwordNew);
	
	
	public String resetPassword(UserInfo userInfo);
	
	/**
	 * 根据角色显示用户信息
	 * @param userInfo
	 * @return
	 */
	public Map<String, Object> userList(UserInfo userInfo) ;
	
	/**
	 * 根据角色标签id查询老师或者服务站
	 * @param labelId
	 * @return
	 */
	public List<UserInfo> userList(UserInfo sessionUserInfo,Integer labelId);
	
	/**
	 * 根据角色不分页显示用户信息
	 * @param userInfo
	 * @return
	 */
	public List<UserInfo> userListNoPage(UserInfo userInfo) ;
	
	/**
	 * 账号验证
	 * @param loginCode
	 * @return
	 */
	public String loginCodeValidate(String loginCode,String stid);
	
	/**
	 * 根据ID查询用户
	 * @param id
	 * @return
	 */
	public UserInfo queryById(int id);
	
	/**
	 * 根据ID修改用户
	 * @param id
	 * @return 
	 */
	public int txUpdateById(UserInfo userInfo);
	
	/**
	 * 根据ids删除用户
	 * @param ids
	 * @return
	 */
	public int txDeleteByIds(int[] ids);
	
	/**
	 * 根据ids禁用、起用用户
	 * @param session 
	 * @param ids
	 * @return
	 */
	public Object updateDisableFlag(UserInfo userInfo, HttpSession session);	
	
	public List<UserInfo> queryLableTypeList();

	/**
	 * 微信通过openid获取用户信息并返回用户
	 * @param info
	 * @param sessionid 
	 * @return
	 */
	public UserInfo weixinLogin(UserInfo info, String sessionid);
	
	/**
	 * 查看session
	 * @param userId
	 * @return
	 */
	public String querySessionByUserId(int userId);

    public String queryPCSessionByUserId(int userId);
	
	public Map<String, Object> queryPageByRoleId(UserInfo userInfo);

	public Object queryByMobilePhone(String mobilePhone);

	public UserInfo queryBindingUserInfoById(int id);
	/**
	 * 通过手机号码查询是不已被注册
	 * @param mobilePhone
	 * @return
	 */
	public Object mobilePhoneValid(String mobilePhone);
	/**
	 * 验证推荐码
	 * @param shareCode
	 * @return
	 */
	public Object validShareCode(String shareCode);
	/**
	 * 更新userInfo
	 * @param info
	 */
	public int updateById(UserInfo info);

	public Object txInsertWechatInfo(UserInfo info, HttpSession session);

	public UserInfo txAutoLogin(String openId, String sessionId);

	public Object queryByOpenId(UserInfo info);

	public Object queryPageTeacherByVideoDesc(UserInfo info);

    Object queryPageTeacherBySortType(VideoInfo info) ;

    Object queryPageTeacherByTypename(VideoInfo videoInfo);

    public Object txToBinding(UserInfo info);

	public Object validateMobilePhone(String mobilePhone, String openId);
	/**
	 * 通过微信openId查询是否为会员
	 * @param openId
	 * @return
	 */
	public Object isVipByOpenId(String openId);
	/**
	 * 通过id获取老师的相关数据
	 * @param id
	 * @return
	 */
	public Object getTeacherInfoById(int id);

	public Object getPageTeacherByName(UserInfo info);

	public Object isBindedByOpenId(String openId);
	/**
	 * 校验手机号码和验证码，微信绑定手机号，
	 * @param openId
	 * @param mobilePhone
	 * @param mobilePhoneCode
	 * @param typeId 
	 * @return
	 */
	public Object weChatToBindMobilePhone(String openId, String mobilePhone,
			String mobilePhoneCode, Integer typeId);
    /**
     * 校验手机号码和验证码，通用绑定手机号，
     * @param id
     * @param mobilePhone
     * @param mobilePhoneCode
     * @param typeId
     * @return
     */
    public Object commomToBindMobilePhone(String id, String mobilePhone,
                                          String mobilePhoneCode, int typeId);

	/**
	 * 根据openId查询userInfo
	 * @param weixinOpenid
	 * @return
	 */
	public UserInfo queryByWeixinOpenid(String weixinOpenid);

	public Object queryPageTeacherByOrderNum(UserInfo info);

    public Object registerForPC(UserInfo info, String mobilePhone, int typeId);

	public Object txInsertShareCodeByUserId(UserInfo info);
	
	/**
	 * 根据分享码判断是否为合作方的分享码或者合作方的推广人
	 * @param recommendCode 
	 * @return
	 */
	public Object isPartnerByRecommendCode(String recommendCode);

	public Object isTeacherByScanShareCode(String recommendCode);

	public Object isExistSelectByUserName(String userName);

    public Object queryPageTeacherWithRecord(UserInfo info);
    /**分页查询管理员信息*/
	public Object queryManagerPage(UserInfo info);

    public Object updatePriceById(UserInfo userInfo);

	public Object queryPageUser(UserInfo userInfo, HttpSession session);

	public Object exportExl(UserInfo userInfo,HttpServletResponse response, HttpSession session);

	/**
	 * 添加管理员
	 * @param userInfo
	 * @param session 
	 */
	public Object addAdminUser(UserInfo userInfo, HttpSession session);

	/**
	 * 分页查询管理员
	 * @param userInfo
	 * @param session 
	 * @return 
	 */
	public Object queryAdminUserByPage(UserInfo userInfo, HttpSession session);


    public Object queryTeacherInfoWithRecord(UserInfo info);

	public Object loginAdmin(UserInfo userInfo,HttpSession session);

    Object updateBankcardByInfo(UserInfo userInfo, HttpSession session);

    Object queryBankCardInfoById(UserInfo userInfo);


	Object queryMyPraise(UserInfo info);	
    public Object updateAdminUserById(UserInfo userInfo, HttpSession session);

    /**
     * 根据unionid查询userInfo
     *
     * @param unionid
     * @return
     */
    public UserInfo queryByWeixinUnionid(String unionid);

	public Object queryMyHappiness(UserHappinessDto dto);

    /**
     * 添加用户 -- lyon
     *
     * @param userInfo
     */
    public int txAddUserInfo(UserInfo userInfo);

	public Object queryMyHappinessChart(UserHappinessDto dto);

	public Map<String, Object> loginWeb(UserInfo userInfo);

    /*
    * 明人 1.3.1 学习记录
    * */
    Object queryStudyRecord(UserHappinessDto dto, HttpSession session);

    Object exportStudyRecord(UserHappinessDto info, HttpServletResponse response, HttpSession session);

	public Object queryInfoByUserId(UserInfo info, HttpSession session);

	public Object queryIntegralBalanceByUserId(Integer userId);

	public Object editMobilePhoneById(UserInfo info);

    public Object queryWisdomUser(UserInfo info);

    //幸福型
    Object queryHappinessRank(UserHappinessDto dto);

    Object queryStudyUser(UserInfo info);

    //幸福型
    Object queryKeepDayRankingList(UserInfo info);

	public Map<String, Object> bingPhoneByUnionId(String mobilePhone,
			String mobilePhoneCode, Integer typeId, HttpSession session);


    Object queryHappinessWall(UserInfo info);

	public Object queryPaidActivityByUserId(HttpSession session, Integer page,
			Integer rows);

	public Object downLoadHeadImg(UserInfo info, Map<String, Object> map);
}
